<?php
/**
 * @version		$Id: view.html.php 7 2011-12-22 13:48:09Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');


class AlmHosterViewBillingcycles extends JView
{	
	protected $items;
	protected $pagination;
	protected $state;
	
	function display($tpl = null) 
	{
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');
		
		$this->country = $this->get('Country');

		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}

		$this->addToolBar();

		parent::display($tpl);
		$this->setDocument();
	}

	
	protected function addToolBar() 
	{
		
		JToolBarHelper::title(JText::_('COM_ALMHOSTER_MENAGE_BILLING_CYCLES'), 'billing_cycles');
		JToolBarHelper::addNew('billingcycle.add', 'COM_ALMHOSTER_TOOLBAR_NEW');
		JToolBarHelper::editList('billingcycle.edit', 'COM_ALMHOSTER_TOOLBAR_EDIT');
		JToolBarHelper::deleteList('', 'billingcycles.delete', 'COM_ALMHOSTER_TOOLBAR_DELETE');
		JToolBarHelper::divider();
		JToolBarHelper::preferences('com_almhoster');
	}


	protected function setDocument() 
	{
		$document = JFactory::getDocument();
		$document->setTitle(JText::_('COM_ALMHOSTER_BILLING_CYCLES_MENAGER_VIEW'));
	}
}
